<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>后台管理</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
    <link rel="stylesheet" href="../css/admin.css">
</head>

<body class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header header">
            <a href="index.html">
                <div class="layui-logo logo">后台管理
                </div>
            </a>
            <!-- 头部区域（可配合layui已有的水平导航） -->

            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item diy-nav">
                    <a href="javascript:;">
                        <img src="http://t.cn/RCzsdCq" class="layui-nav-img"> 贤心
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="basic.html">基本资料</a></dd>
                        <dd><a href="modifypwd.html">安全设置</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item diy-nav"><a href="">注销</a></li>
            </ul>
        </div>

        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree layui-bg-black" lay-filter="test">
                    <li class="layui-nav-item ">
                        <a class="" href="javascript:;"><i class="layui-icon layui-icon-user"> </i>用户</a>
                        <dl class="layui-nav-child">
                            <dd><a class="tabs" href="userManage.html" data-id="33">用户管理</a></dd>
                            <dd><a class="tabs" href="adminManage.html">管理员管理</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item  ">
                        <a href="javascript:;"><i class="layui-icon layui-icon-set-sm"> </i>设置</a>
                        <dl class="layui-nav-child">
                            <dd><a href="setting.html">网站设置</a></dd>
                            <dd class="layui-this"><a href="link.html">友情链接</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item layui-nav-itemed "><a href="#"><i class="layui-icon layui-icon-about"> </i>内容管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="type.html">分类管理</a></dd>
                            <dd class="layui-this"><a href="list.html">帖子列表</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>

        <div class="layui-body">
            <!-- 内容主体区域 -->
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-breadcrumb">
                        <a href="index.html">首页</a>
                        <a href="#">内容管理</a>
                        <a href="list.html">帖子列表</a>
                    </div>
                </div>
            </div>
            <div class="layui-fluid">
                <div class="layui-card-header">
                    <div class="demoTable">
                        <label for="" class="layui-label">搜索ID：</label>
                        <div class="layui-inline">
                            <input class="layui-input" name="id" id="demoReload" autocomplete="off">
                        </div>
                        <label for="" class="layui-label">作者:</label>
                        <div class="layui-inline">
                            <input class="layui-input" name="author" id="demoReload">
                        </div>
                        <label for="" class="layui-label">标题:</label>
                        <div class="layui-inline">
                            <input type="text" class="layui-input" name="title" id="demoReload">
                        </div>
                        文章分类:
                        <div class="layui-inline">
                            <select id="edit_exam_school" class="layui-select">
                                        <option value="">请选择</option>
                                        <option value="1">华南理工大学大学城</option>
                                        <option value="2">华南理工大学五山校区</option>
                                        <option value="3">中山大学珠海校区</option>
                                        <option value="4">中山大学大学城校区</option>
                            </select>

                        </div>
                        <button class="layui-btn" data-type="reload" style="position:relative;left:20px">搜索</button>
                    </div>
                </div>
                <div class="layui-card">
                    <table class="layui-hide" id="type" lay-filter="type"></table>
                </div>
            </div>
        </div>


    </div>

    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © layui.com - 底部固定区域
    </div>
    </div>
    <script src="../layui/layui.js"></script>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
    <style>
        .cardInfo {
            font-size: 36px;
            color: #666;
            line-height: 36px;
            padding: 5px 0 10px;
            overflow: hidden;
            text-overflow: ellipsis;
            word-break: break-all;
            white-space: nowrap;
        }
    </style>

    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <script>
        //JavaScript代码区域
        layui.use(['element', 'table'], function() {
            var element = layui.element;
            var table = layui.table;
            table.render({
                elem: '#type',
                url: '#',
                page: true,
                cols: [
                    [{
                        checkbox: true,
                        fixed: true
                    }, {
                        field: 'id',
                        title: 'id',
                        width: 100
                    }, {
                        field: 'type',
                        title: '分类',
                        width: 120
                    }, {
                        field: 'title',
                        title: '帖子标题',
                        width: 120
                    }, {
                        field: 'author',
                        title: '文章作者',
                        width: 120
                    }, {
                        field: 'addTime',
                        title: '添加时间',
                        width: 120
                    }, {
                        field: 'addMember',
                        title: '添加人',
                        width: 120
                    }, {
                        field: 'status',
                        title: '状态',
                        width: 120
                    }, {
                        fixed: 'right',
                        title: '操作',
                        toolbar: "#barDemo"
                    }]
                ]
            });
            table.on('tool(type)', function() {
                var data = obj.data;
                if (obj.event === 'del') {
                    layer.confirm('真的删除行么', function(index) {
                        obj.del();
                        layer.close(index);
                    });
                } else if (obj.event === 'edit') {
                    layer.alert('编辑行：<br>' + JSON.stringify(data))
                }
            });
            var $ = layui.$,
                active = {
                    addType: function() { //获取选中数据
                        var checkStatus = table.checkStatus('type'),
                            data = checkStatus.data;
                        layer.alert(JSON.stringify(data));
                    }
                };

            $('.demoTable .layui-btn').on('click', function() {
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
            });



        });
    </script>
</body>

</html>